<?php

/* init.php
 * sets various config variables and error reporting
 */

error_reporting(E_ALL);
date_default_timezone_set("Europe/London");
ini_set('display_errors', '1');

$FILE_SYSTEM_ROOT = dirname(dirname(__FILE__));

// get config info
$xml = simplexml_load_file($FILE_SYSTEM_ROOT."/config/config.xml");
if(!isset($xml))echo "$xml not set";

$PathsXML = $xml->Paths;
$DOCUMENT_ROOT = $PathsXML->DocumentRoot;

require_once($FILE_SYSTEM_ROOT."/model/classes/database/Database.php");
if(!isset($xml->Database))echo "$xml->Database not set";
$databaseXML = $xml->Database;
$DATABASE = new Database($databaseXML->Server,$databaseXML->Database,$databaseXML->Username,$databaseXML->Password);

require_once($FILE_SYSTEM_ROOT."/model/classes/events/Event.php");
require_once($FILE_SYSTEM_ROOT."/model/classes/utilities/Users.php");
$users = new Users();
$USERS = $users->getUsers();
require_once($FILE_SYSTEM_ROOT."/model/classes/utilities/Locations.php");
$locations = new Locations();
$LOCATIONS = $locations->getLocations();
require_once($FILE_SYSTEM_ROOT."/model/classes/utilities/Involvees.php");
$involvees = new Involvees();
$INVOLVEES = $involvees->getInvolvees();
require_once($FILE_SYSTEM_ROOT."/model/classes/utilities/EventTypes.php");
$eventTypes = new EventTypes();
$EVENTTYPES = $eventTypes->getEventTypes();

require_once($FILE_SYSTEM_ROOT."/model/classes/people/Groups.php");
$groups = new Groups();
$GROUPS = $groups->getGroups();


require_once($FILE_SYSTEM_ROOT."/model/classes/people/Address.php");
require_once($FILE_SYSTEM_ROOT."/model/classes/people/PeopleResultSet.php");
require_once($FILE_SYSTEM_ROOT."/model/classes/people/Person.php");

require_once($FILE_SYSTEM_ROOT."/model/classes/music/MusicResultSet.php");
require_once($FILE_SYSTEM_ROOT."/model/classes/music/MusicEvent.php");
require_once($FILE_SYSTEM_ROOT."/model/classes/music/MusicHistoryRequest.php");

require_once($FILE_SYSTEM_ROOT."/model/classes/events/EventsResultSet.php");
require_once($FILE_SYSTEM_ROOT."/model/classes/events/Event.php");


